And deprecate the X11-specific version of it.
We call this new API _set_shadow_width() and not _set_frame_extents()
because we already have a gdk_window_get_frame_extents() with a
different meaning and different type of value.
https://bugzilla.gnome.org/show_bug.cgi?id=720374
gdk_window_get_modal_hint
gdk_window_set_type_hint
gdk_window_get_type_hint
+gdk_window_set_shadow_width
gdk_window_set_skip_taskbar_hint
gdk_window_set_skip_pager_hint
gdk_window_set_urgency_hint
if (impl_class->set_opaque_region)
return impl_class->set_opaque_region (window, region);
}
+
+/**
+ * gdk_window_set_shadow_width:
+ * @window: a #GdkWindow
+ * @left: The left extent
+ * @right: The right extent
+ * @top: The top extent
+ * @bottom: The bottom extent
+ *
+ * Newer GTK+ windows using client-side decorations use extra geometry
+ * around their frames for effects like shadows and invisible borders.
+ * Window managers that want to maximize windows or snap to edges need
+ * to know where the extents of the actual frame lie, so that users
+ * don't feel like windows are snapping against random invisible edges.
+ *
+ * Note that this property is automatically updated by GTK+, so this
+ * function should only be used by applications which do not use GTK+
+ * to create toplevel windows.
+ *
+ * Since: 3.12
+ */
+void
+gdk_window_set_shadow_width (GdkWindow *window,
+ gint left,
+ gint right,
+ gint top,
+ gint bottom)
+{
+ GdkWindowImplClass *impl_class;
+
+ g_return_if_fail (GDK_IS_WINDOW (window));
+ g_return_if_fail (!GDK_WINDOW_DESTROYED (window));
+ g_return_if_fail (left >= 0 && right >= 0 && top >= 0 && bottom >= 0);
+
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
+
+ if (impl_class->set_shadow_width)
+ impl_class->set_shadow_width (window, left, right, top, bottom);
+}
GDK_AVAILABLE_IN_3_12
gboolean gdk_window_get_event_compression (GdkWindow *window);
+GDK_AVAILABLE_IN_3_12
+void gdk_window_set_shadow_width (GdkWindow *window,
+ gint left,
+ gint right,
+ gint top,
+ gint bottom);
+
G_END_DECLS
#endif /* __GDK_WINDOW_H__ */
void (* set_opaque_region) (GdkWindow *window,
cairo_region_t *region);
+ void (* set_shadow_width) (GdkWindow *window,
+ gint left,
+ gint right,
+ gint top,
+ gint bottom);
};
/* Interface Functions */
}
}
+static void
+gdk_x11_window_set_shadow_width (GdkWindow *window,
+ int left,
+ int right,
+ int top,
+ int bottom)
+{
+ Atom frame_extents;
+ gulong data[4] = { left, right, top, bottom };
+
+ frame_extents = gdk_x11_get_xatom_by_name_for_display (gdk_window_get_display (window),
+ "_GTK_FRAME_EXTENTS");
+ XChangeProperty (GDK_WINDOW_XDISPLAY (window),
+ GDK_WINDOW_XID (window),
+ frame_extents, XA_CARDINAL,
+ 32, PropModeReplace,
+ (guchar *) &data, 4);
+}
+
/**
* gdk_x11_window_set_frame_extents:
* @window: (type GdkX11Window): a #GdkWindow
* @top: The top extent
* @bottom: The bottom extent
*
- * Newer GTK+ windows using client-side decorations use extra geometry
- * around their frames for effects like shadows and invisible borders.
- * Window managers that want to maximize windows or snap to edges need
- * to know where the extents of the actual frame lie, so that users
- * don't feel like windows are snapping against random invisible edges.
- *
- * Note that this property is automatically updated by GTK+, so this
- * function should only be used by applications which do not use GTK+
- * to create toplevel windows.
+ * This is the same as gdk_window_set_shadow_width() but it only works
+ * on GdkX11Window.
*
* Since: 3.10
+ *
+ * Deprecated: 3.12: Use gdk_window_set_shadow_width() instead.
*/
void
gdk_x11_window_set_frame_extents (GdkWindow *window,
int top,
int bottom)
{
- Atom frame_extents;
- gulong data[4] = { left, right, top, bottom };
-
- frame_extents = gdk_x11_get_xatom_by_name_for_display (gdk_window_get_display (window),
- "_GTK_FRAME_EXTENTS");
- XChangeProperty (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window),
- frame_extents, XA_CARDINAL,
- 32, PropModeReplace,
- (guchar *) &data, 4);
+ gdk_x11_window_set_shadow_width (window, left, right, top, bottom);
}
/**
impl_class->delete_property = _gdk_x11_window_delete_property;
impl_class->get_scale_factor = gdk_x11_window_get_scale_factor;
impl_class->set_opaque_region = gdk_x11_window_set_opaque_region;
+ impl_class->set_shadow_width = gdk_x11_window_set_shadow_width;
}
GDK_AVAILABLE_IN_3_2
void gdk_x11_window_set_theme_variant (GdkWindow *window,
char *variant);
-GDK_AVAILABLE_IN_3_10
+GDK_DEPRECATED_IN_3_12_FOR(gdk_window_set_shadow_width)
void gdk_x11_window_set_frame_extents (GdkWindow *window,
int left,
int right,
}
static void
-update_frame_extents (GtkWindow *window,
- GtkBorder *border)
+update_shadow_width (GtkWindow *window,
+ GtkBorder *border)
{
-#ifdef GDK_WINDOWING_X11
GdkWindow *gdk_window;
gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
- if (GDK_IS_X11_WINDOW (gdk_window))
- gdk_x11_window_set_frame_extents (gdk_window,
- border->left,
- border->right,
- border->top,
- border->bottom);
-#endif
+ if (gdk_window)
+ gdk_window_set_shadow_width (gdk_window,
+ border->left,
+ border->right,
+ border->top,
+ border->bottom);
}
static void
priv->title_height = 0;
if (priv->client_decorated)
- update_frame_extents (window, &window_border);
+ update_shadow_width (window, &window_border);
update_opaque_region (window, &window_border, &child_allocation);